using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;

namespace XFGameFramework.ExcelSystem
{

    /// <summary>
    /// 自定义字段导入导出的特性
    /// </summary>
    public abstract class CustomExcelFieldImportAndExport : Attribute
    {

        /// <summary>
        /// 在导入时调用
        /// </summary>
        /// <param name="scriptableObject">ScriptableObject对象</param>
        /// <param name="value">excel中数据</param>
        /// <param name="type">字段类型</param>
        /// <returns></returns>

        public abstract object Import(object scriptableObject,object value, ExcelFieldsType type);

        /// <summary>
        /// 在导出时调用
        /// </summary>
        /// <param name="scriptableObject">ScriptableObject对象</param>
        /// <param name="value">字段的对象</param>
        /// <param name="type">字段类型</param>
        /// <returns></returns>
        public abstract object Export(object scriptableObject,object value, ExcelFieldsType type);

        /// <summary>
        /// 在导入时设置字段的值时调用
        /// </summary>
        /// <param name="scriptableObject">ScriptableObject对象</param>
        /// <param name="fieldInfo">字段信息</param>
        /// <param name="value">这个value是Import的返回值</param>
        /// <exception cref="System.NotImplementedException"></exception>
        public abstract void SetValue(object scriptableObject, FieldInfo fieldInfo, object value);
         
    }

}

